﻿using S.RBAC.Domain.Model;
using S.RBAC.Infrastructure.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace S.RBAC.Infrastructure.Impl
{
    public class RoleJurisdictionRepository : BaseRepository<RoleJurisdiction>, IRoleJurisdictionRepository
    {
        public RoleJurisdictionRepository(EFCoreContext context) : base(context)
        {
        }

        public async Task<int> AddRoleJurisdiction(RoleJurisdiction roleJurisdiction)
        {
            return await AddAsync(roleJurisdiction);
        }

        public async Task<int> DelRoleJurisdiction(int rjId)
        {
            return await DelAsync(rjId);
        }

        public async Task<List<RoleJurisdiction>> GetAllRoleJurisdiction()
        {
            return await GetAllAsync();
        }

        public async Task<RoleJurisdiction> GetRoleJurisdiction(int rjId)
        {
            return await GetAsync(rjId);
        }

        public async Task<int> UpdRoleJurisdiction(RoleJurisdiction roleJurisdiction)
        {
            return await UpdateAsync(roleJurisdiction);
        }
    }
}
